﻿using Furion;
using Furion.Schedule;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MqttClient
{
    [AppStartup(50)]
    public class RobotStarUp : AppStartup
    {
        public RobotStarUp()
        {
            System.Console.WriteLine("Robot");
        }



        public void ConfigureServices(IServiceCollection services)
        {
            services.AddTaskQueue();
            

            services.AddSchedule(options =>
            {
                //options.AddJob(JobBuilder.Create<MyJob>().SetIncludeAnnotations(true)
                //    , Triggers.PeriodSeconds(5));     // 这里可传可不传，传了则会自动载入特性和这里配置的作业触发器

                // 还可以更简单~~
                //  options.AddJob(typeof(MyJob).ScanToBuilder());

                // 还可以批量新增 Furion 4.8.2.4+
                options.AddJob(App.EffectiveTypes.ScanToBuilders());
            });


        }

    }
}
